//
//  ocsocket.h
//  FFmpeg_X264_Codec
//
//  Created by luwinglee on 16/1/8.
//  Copyright © 2016年 suntongmian@163.com. All rights reserved.
//

#import <Foundation/Foundation.h>

@protocol NetworkProtocol;

@interface ocsocket : NSObject

@property(nonatomic,assign) id<NetworkProtocol> delegate;

/**
 初始化网络对象
 @ip:网络地址
 @port:网络端口
 @netType:TCP or UDP
 @return:返回对象ID
*/
-(id)initWithIPaddr:(char *)ip andPort:(int) port andType:(int) netType;

-(void) deInit;

-(int)sendData:(char *)data andSize:(int) size;

@end

//声明协议中的接口函数
@protocol  NetworkProtocol <NSObject>

@required
- (void)recvDataCallBack:(char *)data andSize:(int)size;

//@optional
//- (void)resultDisplayCallBack:(NSString *)backInfo;

@end
